Skip to main content

Zenith Customer Contract Import

Introduction

This will import zenith vehicles in to ViSN, without creating sub customers for zenith

download sample zenith customer contract import file.

File format

Comma Separated Values - *.csv
Encoding - UTF-8

Zenith Customer Customers Import

Zenith Customer contract fieldsDescriptionMax lengthData TypeRulesMandatoryDefault ValuesExample
RegistrationVehicle Registration number10StringA-Z & 0-9 CharactersY200LTW
VINVehicle identification number20StringA-Z 0-9 and Special CharactersNSALCA2AN9MH890904
Asset NumberAsset Number50StringA-Z & 0-9, space and hyphen (-)N88 AX29-UE39
Registration DateRegistration DateNANumberDDMMYYYYN30102024
MakeMake of the vehicle50StringA-Z 0-9 and Special CharactersNFord
ModelModel of the vehicle50StringA-Z 0-9 and Special CharactersNEscape
SpecificationSpecification100StringA-Z 0-9 and Special CharactersNManual transmission
Fuel TypeFuel type of vehicle50StringA-Z 0-9 and Special CharactersNPetrol
Vehicle TypeType of vehicleNAStringNAYValid vehicle types:
Car, LCV, Van, Commercial (under 3.5), Commercial (over 3.5), HGV, Motor Bike, Electric Car
Contract Start Date Start date of contractNANumberDDMMYYYYN30102024
Contract End DateEnd date of contractNANumberDDMMYYYYN30102024
Contract Mileage TermMileage of Vehicle6Number0-9N33448
CAPIDCap Id20StringA-Z 0-9 and Special CharactersNQW82JK764HSN
Argic CodeArgic Code20StringA-Z 0-9 and Special CharactersN82JK764HSN
ColourColour of Vehicle200StringA-Z 0-9 and Special CharactersNPearl White
MOT Due dateLast date for MOTNANumberDDMMYYYYN30102024
MaintainedOnly "Maintained" vehicles are imported, if the value is other than Y, then it is ignored and a log is added
NAStringY or NNY
Service ScheduleService Schedule8Number0-9N23821828
Warranty Parameter MonthsWarranty parameter months3Number0-9N24
Warranty Parameter MileageWarranty mileage6Number0-9N223445
FridgeFridgeNAStringY or NNNN
Tail LiftTail LiftNAStringY or NNNN
CraneCraneNAStringY or NNNN
Customer NameCustomer Name100StringA-Z 0-9 and Special CharactersNCitroën
Customer Account NumberCustomer Account Number50StringA-Z 0-9 and Special CharactersNXW442TYW
VAT NumberVAT Number 15StringA-Z 0-9 and Special CharactersNGB33IW88W
Address 1Building Number 50StringA-Z 0-9 and Special CharactersN90-92
Address 2Street Name 100StringA-Z 0-9 and Special CharactersNYarm Ln
Address 3District50StringA-Z 0-9 and Special CharactersNStockton
Address 4Town100StringA-Z 0-9 and Special CharactersNTees
Address 5County50StringA-Z 0-9 and Special CharactersNConford
PostcodePostcode15StringA-Z 0-9NTS181LA
SMRSMRNAStringY or NNNN
TyresTyresNAStringY or NNNN
GlassGlassNAStringY or NNNN
Accident ManagementAccident ManagementNAStringY or NNNN
BreakdownBreakdownNAStringY or NNNN
InsuranceInsuranceNAStringY or NNNN
RentalRentalNAStringY or NNNN
Cost CentreCost Centre15StringA-Za-z0-9_@./'#&+-/(/)' 'N23-4523
Invoice CentreInvoice Centre15StringA-Za-z0-9_@./'#&+-/(/)' 'N68-0931
Customer ContactContact Number 15Number0-9N828392342
Customer NumberCustomer Number15Number0-9N828392342
Customer EmailCustomer Email50StringStandard email formatNusername@email.com
Customer Policy NotesCustomer Policy Notes250StringA-Z 0-9 and Special CharactersNAdvised the customer to update their payment information.
Customer Recharge LimitCustomer Recharge Limit6Number0-9N23821828
Customer Referral LimitCustomer Referral Limit6Number0-9N24
Driver FirstnameDriver first name50StringA-Z 0-9 and Special CharactersNAndré
Driver LastnameDriver Last name50StringA-Z 0-9 and Special CharactersNFrédéric
Driver EmailDriver Email50StringStandard email formatNdriver@email.com
Driver NumberDriver Number11Number0-9N23821828
Policy NumberPolicy Number25StringA-Z & 0-9 Space, Dash and hyphenN931-292
Policy Start DatePolicy Start DateNANumberDDMMYYYYN30102024
Policy End DatePolicy End DateNANumberDDMMYYYYN30102024
Policy TermPolicy Term100StringA-Z 0-9 and Special CharactersNThe policy term is valid from 01/01/2024 to 12/31/2024
Product TypeProduct Type20Stringa-z A-Z 0-9NWR91OJ

Importing a file

Preparation

  1. Create a new branch with Jira task number in the branch name

  2. Delete all the files in importFiles folder

  3. Create a folder with the current sprint number

  4. Copy the file that needs to be imported

  5. Go to package.json , find the line validate:zenithCustomerContractWithoutSubCustomer

  6. Modify --leaseId with the required lease Id

  7. Modify --file with the relative path of the file

  8. Save package.json

Validating locally

  1. in a terminal run npm run build

  2. in a terminal run npm run validate:zenithCustomerContractWithoutSubCustomer

  3. If there are no errors, push the code

Validating in workflow

  1. Go to Action of Import-manger

  2. Find <Environment> - on-demand-import

  3. Select the branch that was created for this import

  4. Enter script name as validate:zenithCustomerContractWithoutSubCustomer

  5. Leave Overrides empty

Importing the file

  1. If the validation has passed

  2. Go to Action of Import-manger

  3. Find <Environment> - on-demand-import

  4. Select the branch that was created for this import

  5. Enter script name as import:zenithCustomerContractWithoutSubCustomer

  6. Enter --persist in Overrides field

Importing the file via cloud run

Creating Schedulers for validating the zenith customer contract

  1. Go to Cloud Scheduler and select the CREATE JOB

Setup Required

A Scheduler should be created cloud scheduler with the following parameters

  • Name: zenith_customer_contract_import_without_sub_customers_file_validation
  • Region: europe-west2
  • Frequency: 0 0 31 12 1
  • TimeZone: GMT London
  • Target type: HTTP
  • URL: https://import-manager-36r2bu4izq-uc.a.run.app/zenith-customer-contract-without-sub-customers
  • HTTP method: POST
  • Auth header: select OIDC token
  • Service account: cloud-run-import-customer-contract
  • body: a JSON object including the following parameters

JSON object for zenith_customer_contract_import_without_sub_customers_file_validation scheduler

{
"leaseId": "QJKgdjS4I02sEia4yTne",
"leaseCompanyName": "Next Fleet Services",
"persist": "false",
"bucket": "biddirect-2.appspot.com",
"appDirectory": "/usr/src/app/",
"importPath": "imports/fileDrop/",
"importFileDropPath": "imports/fileDrop/",
"importFileName": "zenithCustomerContractWithoutSubCustomers.csv",
"email": "mailgun@digitalinnk.com",
"fatalErrorEmailToAddress": "mailgun@digitalinnk.com",
"schema": "ZENITH_CUSTOMER_CONTRACT_WITHOUT_SUB_CUSTOMERS"
}

Create scheduler for validating Zenith customer contract

Creating Schedulers for importing the zenith customer contract

  1. Go to Cloud Scheduler and select the CREATE JOB

Setup Required

A Scheduler should be created cloud scheduler with the following parameters

  • Name: zenith_customer_contract_file_import_without_sub_customers
  • Region: europe-west2
  • Frequency: 0 0 31 12 1
  • TimeZone: GMT London
  • Target type: HTTP
  • URL: https://import-manager-36r2bu4izq-uc.a.run.app/zenith-customer-contract-without-sub-customers
  • HTTP method: POST
  • Auth header: select OIDC token
  • Service account: cloud-run-import-customer-contract
  • body: a JSON object including the following parameters

JSON object for zenith_sub_customer_file_import scheduler

{
"leaseId": "QJKgdjS4I02sEia4yTne",
"leaseCompanyName": "Next Fleet Services",
"persist": "true",
"bucket": "biddirect-2.appspot.com",
"appDirectory": "/usr/src/app/",
"importPath": "imports/fileDrop/",
"importFileDropPath": "imports/fileDrop/",
"importFileName": "zenithCustomerContractWithoutSubCustomers.csv",
"email": "mailgun@digitalinnk.com",
"fatalErrorEmailToAddress": "mailgun@digitalinnk.com",
"schema": "ZENITH_CUSTOMER_CONTRACT_WITHOUT_SUB_CUSTOMERS"
}

Create scheduler for importing Zenith customer contract

Preparation:

  1. Bucket name is biddirect-2.appspot.com and it will vary for higher envs and the file path should imports/fileDrop, where you can drop the CSV file named "zenithCustomerContractWithoutSubCustomers". This action will place the file in the specified location within the designated bucket.

Validation:

  1. Go to Cloud Scheduler
  2. Run zenith_customer_contract_import_without_sub_customers_file_validation job (job name could be different on other env)
logs in cloud

Importing:

  1. Go to Cloud Scheduler
  2. Run zenith_customer_contract_file_import_without_sub_customers job (job name could be different on other env)
logs in cloud

Testing

  1. Zenith vehicles will be imported, You can verify this by navigating to the ViSN customer platform and selecting Vehicle Record search for imported vehicle.
Status: Pending Approval
Category: Protected
Authored By: Hadley on August 6, 2024
Revisions